@extends('admin/layout/main')

@section('content')
    <a href="{{ url('admin/role/index') }}" class="btn btn-primary" style="float:right;margin-bottom:20px">返回</a>

    <form class="form-horizontal" style="clear:both" action="{{ url('admin/role/update/' . $role['id']) }}" method="post">

        @if($parentRoleName != '')
            <div class="form-group">
                <label class="col-sm-2 control-label">权限父类名称</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" disabled value="{{ $parentRoleName }}">
                </div>
            </div>
        @endif

        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">权限名称</label>
            <div class="col-sm-10">
                <input type="text" name="role_name" class="form-control" id="inputEmail3" placeholder="权限名称" value="{{ $role['role_name'] }}">
                <p class="help-block" style="color:red;">{{ $errors->first('role_name') }}</p>
            </div>
        </div>

        <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">权限描述</label>
            <div class="col-sm-10">
                <textarea class="form-control" name="role_des" rows="3">{{ $role['role_des'] }}</textarea>
                <p class="help-block" style="color:red;">{{ $errors->first('role_des') }}</p>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">确认</button>
            </div>
        </div>
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
        <input type="hidden" name="hid" value="{{ $role['id'] }}"/>
            <input type="hidden" name="pid" value="{{ $role['role_pid'] }}"/>
    </form>
@endsection